﻿@page
@using Localization.Resources.AbpUi
@using Microsoft.Extensions.Localization
@using Topthink.Ruitu.QuestionBank.Pages
@using Volo.Abp.Users
@model IndexModel
@inject IStringLocalizer<AbpUiResource> Localizer
@inject ICurrentUser CurrentUser

<abp-card>
    <abp-card-header>@Localizer["Welcome"]</abp-card-header>
    <abp-card-body>
        @if (!CurrentUser.IsAuthenticated)
        {
            <p><a abp-button="Primary" href="/Account/Login"><i class="fa fa-sign-in"></i> @Localizer["Login"]</a></p>
        }
        else
        {
            <div>
                <abp-row>
                    <abp-column size-md="_3" class="text-center">
                        <i class="fa fa-user d-block" style="font-size: 5em; color: #12b900"></i>
                        <a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account">@Localizer["Logout"]</a>
                    </abp-column>
                    <abp-column size-md="_9">
                        <h2>@CurrentUser.UserName</h2>
                        <h5 class="text-muted">@CurrentUser.Email</h5>
                        <div>
                            <strong>@Localizer["Roles"]</strong>: @CurrentUser.Roles.JoinAsString(", ")
                        </div>
                    </abp-column>
                </abp-row>
            </div>
        }
        <hr />
        <p class="text-right"><a href="https://abp.io?ref=tmpl" target="_blank">abp.io</a></p>
    </abp-card-body>
</abp-card>